<template>
	<view>
		<view class="box">
			<view class="nns">
				<view class="box-box" @click="goUserInfo">
					<view>
						<image :src="avatar!=''?avatar:'../../static/my/tx.png'" mode=""></image>
					</view>
					<view>
						{{userInfo.nickname || ''}}
					</view>
				</view>
				<!-- 我的应用 -->
				<view class="kks">
					<h3>我的应用</h3>
					<view class="kks-for" v-for="(time,index) in list" @click="tz(time.name)">
						<image :src="time.url" mode=""></image>
						<p>{{time.name}}</p>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [
					{ name: "账户管理", url: "../../static/my/hetong.png" },
					// { name: "运费垫资", url: "../../static/my/yunfei.png" },
					// { name: "我的合同", url: "../../static/my/zhanghu.png" },
					// { name: "保证金", url: "../../static/my/baozhengjin.png" },
					// { name: "运单列表", url: "../../static/my/bianzu.png" },
					// { name: "车辆列表", url: "../../static/my/yunfei.png" },
					// { name: "增加车费申请列表", url: "../../static/my/yunfei.png" },
					{ name: "运费申请", url: "../../static/my/yunfei.png" },
				],
				avatar: "",
				userInfo: {},
			}
		},
		onLoad() {

		},
		onShow() {
			this.avatar = uni.getStorageSync('avatar');
			this.userInfo = uni.getStorageSync('userInfo');
		},
		methods: {
			// 跳转页面
			tz(x) {
				let url = ""
				if (x == "账户管理") {
					uni.navigateTo({ url: "./a_zhaunghuguanli" })
				} else if (x == "运费垫资") {
					uni.navigateTo({ url: "./c_yunshudianzi" })
				} else if (x == "我的合同") {
					uni.navigateTo({ url: './e_wodehetong' })
				} else if (x == "保证金") {
					uni.navigateTo({ url: '/pages/bond/b_baozhengjin' })
				} else if (x == "运单列表") {
					uni.navigateTo({ url: './d_yunshuliebiao' })
				} else if (x == "车辆列表") {
					uni.navigateTo({ url: './vehicle-list/vehicle-list' })
				} else if (x == "增加车费申请列表") {
					uni.navigateTo({ url: "/pages/index/increase-fare-list/increase-fare-list" })
				} else if (x == "运费申请") {
					uni.navigateTo({ url: "/pages/i2/apply_freight/apply_list" })
				}
			},
			goUserInfo() {
				uni.navigateTo({
					url: "/pages/subpack1/userinfo/userinfo"
				})
			}
		}
	}
</script>
<style>
	page {
		background: #F7F7F7;
	}
</style>
<style scoped>
	.kks>h3 {
		text-align: center;
		font-size: 22px;
		font-weight: 600;
		padding-top: 40px;
		padding-bottom: 20px;
	}

	.kks-for {
		margin-top: 20px;
		width: 50%;
		float: left;
		text-align: center;
	}

	.kks-for>image {
		width: 70px;
		height: 70px;

	}

	.kks-for>p {
		font-weight: 600;
		font-size: 18px;
		margin-top: 10px;
	}

	.kks {
		overflow: hidden;
		padding-bottom: 100px;
		width: 100%;
		background: #FFFFFF;
		border-radius: 8px;
	}

	.box-box {
		width: 100%;
		display: flex;
	}

	.nns {
		padding-top: 10px;
		width: 95%;
		margin: 0 auto;
	}

	.box-box>view {
		font-weight: bold;
		font-size: 30rpx;
		color: #fff;
		line-height: 64px;
		margin-left: 7px;
	}

	.box-box>view>image {
		width: 64px;
		height: 64px;
		border-radius: 50px;
	}

	.box {
		width: 100%;
		height: 200px;
		background: #1890FF;
		border-radius: 0 0 100px 100px;
	}
</style>